package com.pay.utils.validate.vali_util;

/**
 * 返回给前台的 错误代码 和 提示
 *
 * @author MENG
 * @version 2018/9/15
 * @see
 */
public enum ValidateCodeEnum
{
    //当code == 00000 程序调用成功
    SUCCESS("00000","SUCCESS"),
    REQUIRE_FIELD("00001","不能为空."),
    LENGTH_ILLEGAL("00002","长度不合法."),
    EMAIL_ILLEGAL("00003","邮箱格式不合法."),
    NUMBER_ILLEGAL("00004","数字格式不合法."),
    DATE_ILLEGAL("00005","日期格式不合法."),
    PHONE_ILLEGAL("00006","手机号格式不合法."),



    /**
     * SPRING 异常 错误代码
     */
    HTTP_MESSAGE_NOT_READABLE_EXCEPTION("90001","[Spring 程序异常(HTTP_MESSAGE_NOT_READABLE_EXCEPTION:400)]JSON格式参数转换错误."),

    TYPE_MISMATCH_EXCEPTION("90002","[Spring 程序异常(TYPE_MISMATCH_EXCEPTION:400)]类型不匹配异常"),

    MISSING_SERVLET_REQUEST_PARAMETER_EXCEPTION("90002","[Spring 程序异常(MISSING_SERVLET_REQUEST_PARAMETER_EXCEPTION:400)]缺少servlet请求参数异常"),

    HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION("90003","[Spring 程序异常(HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION:405)]不支持HTTP请求方法异常"),

    HTTP_MEDIA_TYPE_NOT_ACCEPTABLE_EXCEPTION("90004","[Spring 程序异常(HTTP_MEDIA_TYPE_NOT_ACCEPTABLE_EXCEPTION:406)]HTTP媒体类型不可接受异常"),

    SYSTEM_ERROR("99999","后台维护中,请稍后再试."),
    ;


    private String code;

    private String message;

    ValidateCodeEnum(String code, String message)
    {
        this.code = code;

        this.message = message;
    }

    public String getCode()
    {
        return code;
    }

    public String getMessage()
    {
        return message;
    }
}
